class A():
    a = 1

    @classmethod
    def getA(cls):
        return cls.a

    def getAByInit(self , name):
        return self.a

class B(A):
    b = 2

    @classmethod
    def getA(cls):
        return cls.b

    def getAByInit(self , name):
        return str(A.a) + name

a = A()
b = B()
#print("需要new一下：" , str(a.getAByInit()))
#print("静态方法：" , str(A.getA()))

#print(B.getAByInit(a,name="coco"))